"use strict";(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([["vendors-node_modules_github_relative-time-element_dist_index_js"],{68897:(t,e,i)=>{i.d(e,{nJ:()=>L});var s,a,r,n,o,h,l,u,m,d,c,f,g=function(t,e,i,s,a){if("m"===s)throw TypeError("Private method is not writable");if("a"===s&&!a)throw TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?a.call(t,i):a?a.value=i:e.set(t,i),i},y=function(t,e,i,s){if("a"===i&&!s)throw TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(t):s?s.value:e.get(t)};let ListFormatPonyFill=class ListFormatPonyFill{formatToParts(t){let e=[];for(let i of t)e.push({type:"element",value:i}),e.push({type:"literal",value:", "});return e.slice(0,-1)}};let w="undefined"!=typeof Intl&&Intl.ListFormat||ListFormatPonyFill,p=[["years","year"],["months","month"],["weeks","week"],["days","day"],["hours","hour"],["minutes","minute"],["seconds","second"],["milliseconds","millisecond"]],b={minimumIntegerDigits:2};let DurationFormat=class DurationFormat{constructor(t,e={}){s.set(this,void 0);let i=String(e.style||"short");"long"!==i&&"short"!==i&&"narrow"!==i&&"digital"!==i&&(i="short");let a="digital"===i?"numeric":i,r=e.hours||a;a="2-digit"===r?"numeric":r;let n=e.minutes||a;a="2-digit"===n?"numeric":n;let o=e.seconds||a;a="2-digit"===o?"numeric":o;let h=e.milliseconds||a;g(this,s,{locale:t,style:i,years:e.years||"digital"===i?"short":i,yearsDisplay:"always"===e.yearsDisplay?"always":"auto",months:e.months||"digital"===i?"short":i,monthsDisplay:"always"===e.monthsDisplay?"always":"auto",weeks:e.weeks||"digital"===i?"short":i,weeksDisplay:"always"===e.weeksDisplay?"always":"auto",days:e.days||"digital"===i?"short":i,daysDisplay:"always"===e.daysDisplay?"always":"auto",hours:r,hoursDisplay:"always"===e.hoursDisplay?"always":"digital"===i?"always":"auto",minutes:n,minutesDisplay:"always"===e.minutesDisplay?"always":"digital"===i?"always":"auto",seconds:o,secondsDisplay:"always"===e.secondsDisplay?"always":"digital"===i?"always":"auto",milliseconds:h,millisecondsDisplay:"always"===e.millisecondsDisplay?"always":"auto"},"f")}resolvedOptions(){return y(this,s,"f")}formatToParts(t){let e=[],i=y(this,s,"f"),a=i.style,r=i.locale;for(let[s,a]of p){let n=t[s];if("auto"===i[`${s}Display`]&&!n)continue;let o=i[s],h="2-digit"===o?b:"numeric"===o?{}:{style:"unit",unit:a,unitDisplay:o};e.push(new Intl.NumberFormat(r,h).format(n))}return new w(r,{type:"unit",style:"digital"===a?"short":a}).formatToParts(e)}format(t){return this.formatToParts(t).map(t=>t.value).join("")}};s=new WeakMap;let v=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,M=["year","month","week","day","hour","minute","second","millisecond"],D=t=>v.test(t);let Duration=class Duration{constructor(t=0,e=0,i=0,s=0,a=0,r=0,n=0,o=0){this.years=t,this.months=e,this.weeks=i,this.days=s,this.hours=a,this.minutes=r,this.seconds=n,this.milliseconds=o,this.years||(this.years=0),this.sign||(this.sign=Math.sign(this.years)),this.months||(this.months=0),this.sign||(this.sign=Math.sign(this.months)),this.weeks||(this.weeks=0),this.sign||(this.sign=Math.sign(this.weeks)),this.days||(this.days=0),this.sign||(this.sign=Math.sign(this.days)),this.hours||(this.hours=0),this.sign||(this.sign=Math.sign(this.hours)),this.minutes||(this.minutes=0),this.sign||(this.sign=Math.sign(this.minutes)),this.seconds||(this.seconds=0),this.sign||(this.sign=Math.sign(this.seconds)),this.milliseconds||(this.milliseconds=0),this.sign||(this.sign=Math.sign(this.milliseconds)),this.blank=0===this.sign}abs(){return new Duration(Math.abs(this.years),Math.abs(this.months),Math.abs(this.weeks),Math.abs(this.days),Math.abs(this.hours),Math.abs(this.minutes),Math.abs(this.seconds),Math.abs(this.milliseconds))}static from(t){var e;if("string"==typeof t){let i=String(t).trim(),s=i.startsWith("-")?-1:1,a=null===(e=i.match(v))||void 0===e?void 0:e.slice(1).map(t=>(Number(t)||0)*s);return a?new Duration(...a):new Duration}if("object"==typeof t){let{years:e,months:i,weeks:s,days:a,hours:r,minutes:n,seconds:o,milliseconds:h}=t;return new Duration(e,i,s,a,r,n,o,h)}throw RangeError("invalid duration")}static compare(t,e){let i=Date.now(),s=Math.abs(T(i,Duration.from(t)).getTime()-i),a=Math.abs(T(i,Duration.from(e)).getTime()-i);return s>a?-1:s<a?1:0}toLocaleString(t,e){return new DurationFormat(t,e).format(this)}};function T(t,e){let i=new Date(t);return i.setFullYear(i.getFullYear()+e.years),i.setMonth(i.getMonth()+e.months),i.setDate(i.getDate()+7*e.weeks+e.days),i.setHours(i.getHours()+e.hours),i.setMinutes(i.getMinutes()+e.minutes),i.setSeconds(i.getSeconds()+e.seconds),i}function k(t,e="second",i=Date.now()){let s=t.getTime()-i;if(0===s)return new Duration;let a=Math.sign(s),r=Math.abs(s),n=Math.floor(r/1e3),o=Math.floor(n/60),h=Math.floor(o/60),l=Math.floor(h/24),u=Math.floor(l/30),m=Math.floor(u/12),d=M.indexOf(e)||M.length;return new Duration(d>=0?m*a:0,d>=1?(u-12*m)*a:0,0,d>=3?(l-30*u)*a:0,d>=4?(h-24*l)*a:0,d>=5?(o-60*h)*a:0,d>=6?(n-60*o)*a:0,d>=7?(r-1e3*n)*a:0)}function A(t,{relativeTo:e=Date.now()}={}){if(e=new Date(e),t.blank)return t;let i=t.sign,s=Math.abs(t.years),a=Math.abs(t.months),r=Math.abs(t.weeks),n=Math.abs(t.days),o=Math.abs(t.hours),h=Math.abs(t.minutes),l=Math.abs(t.seconds),u=Math.abs(t.milliseconds);u>=900&&(l+=Math.round(u/1e3)),(l||h||o||n||r||a||s)&&(u=0),l>=55&&(h+=Math.round(l/60)),(h||o||n||r||a||s)&&(l=0),h>=55&&(o+=Math.round(h/60)),(o||n||r||a||s)&&(h=0),n&&o>=12&&(n+=Math.round(o/24)),!n&&o>=21&&(n+=Math.round(o/24)),(n||r||a||s)&&(o=0);let m=e.getFullYear(),d=e.getMonth(),c=e.getDate();return(n>=27||s+a&&n)&&(e.setDate(c+n*i),(a+=Math.abs(e.getFullYear()>=m?e.getMonth()-d:e.getMonth()-d-12))&&(n=0),d=e.getMonth()),n>=6&&(r+=Math.round(n/7)),(r||a||s)&&(n=0),r>=4&&(a+=Math.round(r/4)),(a||s)&&(r=0),(a>=11||s&&a)&&(e.setMonth(e.getMonth()+a*i),s+=Math.abs(m-e.getFullYear())),s&&(a=0),new Duration(s*i,a*i,r*i,n*i,o*i,h*i,l*i,u*i)}function E(t,e){let i=A(t,e);if(i.blank)return[0,"second"];for(let t of M){if("millisecond"===t)continue;let e=i[`${t}s`];if(e)return[e,t]}return[0,"second"]}var x=function(t,e,i,s){if("a"===i&&!s)throw TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(t):s?s.value:e.get(t)},S=function(t,e,i,s,a){if("m"===s)throw TypeError("Private method is not writable");if("a"===s&&!a)throw TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?a.call(t,i):a?a.value=i:e.set(t,i),i};let F="undefined"!=typeof globalThis?globalThis:window,C=F.HTMLElement||null,_=new Duration,R=new Duration(0,0,0,0,0,1);let RelativeTimeUpdatedEvent=class RelativeTimeUpdatedEvent extends Event{constructor(t,e,i,s){super("relative-time-updated",{bubbles:!0,composed:!0}),this.oldText=t,this.newText=e,this.oldTitle=i,this.newTitle=s}};function P(t){if(!t.date)return 1/0;if("duration"===t.format||"elapsed"===t.format){let e=t.precision;if("second"===e)return 1e3;if("minute"===e)return 6e4}let e=Math.abs(Date.now()-t.date.getTime());return e<6e4?1e3:e<36e5?6e4:36e5}let I=new class{constructor(){this.elements=new Set,this.time=1/0,this.timer=-1}observe(t){if(this.elements.has(t))return;this.elements.add(t);let e=t.date;if(e&&e.getTime()){let e=P(t),i=Date.now()+e;i<this.time&&(clearTimeout(this.timer),this.timer=setTimeout(()=>this.update(),e),this.time=i)}}unobserve(t){this.elements.has(t)&&this.elements.delete(t)}update(){if(clearTimeout(this.timer),!this.elements.size)return;let t=1/0;for(let e of this.elements)t=Math.min(t,P(e)),e.update();this.time=Math.min(36e5,t),this.timer=setTimeout(()=>this.update(),this.time),this.time+=Date.now()}};let relative_time_element_RelativeTimeElement=class relative_time_element_RelativeTimeElement extends C{constructor(){super(...arguments),a.add(this),r.set(this,!1),n.set(this,!1),h.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this),f.set(this,null)}static get observedAttributes(){return["second","minute","hour","weekday","day","month","year","time-zone-name","prefix","threshold","tense","precision","format","format-style","datetime","lang","title"]}get onRelativeTimeUpdated(){return x(this,f,"f")}set onRelativeTimeUpdated(t){x(this,f,"f")&&this.removeEventListener("relative-time-updated",x(this,f,"f")),S(this,f,"object"==typeof t||"function"==typeof t?t:null,"f"),"function"==typeof t&&this.addEventListener("relative-time-updated",t)}get second(){let t=this.getAttribute("second");if("numeric"===t||"2-digit"===t)return t}set second(t){this.setAttribute("second",t||"")}get minute(){let t=this.getAttribute("minute");if("numeric"===t||"2-digit"===t)return t}set minute(t){this.setAttribute("minute",t||"")}get hour(){let t=this.getAttribute("hour");if("numeric"===t||"2-digit"===t)return t}set hour(t){this.setAttribute("hour",t||"")}get weekday(){let t=this.getAttribute("weekday");return"long"===t||"short"===t||"narrow"===t?t:"datetime"===this.format&&""!==t?this.formatStyle:void 0}set weekday(t){this.setAttribute("weekday",t||"")}get day(){var t;let e=null!==(t=this.getAttribute("day"))&&void 0!==t?t:"numeric";if("numeric"===e||"2-digit"===e)return e}set day(t){this.setAttribute("day",t||"")}get month(){let t=this.format,e=this.getAttribute("month");if(""!==e&&(null!=e||(e="datetime"===t?this.formatStyle:"short"),"numeric"===e||"2-digit"===e||"short"===e||"long"===e||"narrow"===e))return e}set month(t){this.setAttribute("month",t||"")}get year(){var t;let e=this.getAttribute("year");return"numeric"===e||"2-digit"===e?e:this.hasAttribute("year")||new Date().getUTCFullYear()===(null===(t=this.date)||void 0===t?void 0:t.getUTCFullYear())?void 0:"numeric"}set year(t){this.setAttribute("year",t||"")}get timeZoneName(){let t=this.getAttribute("time-zone-name");if("long"===t||"short"===t||"shortOffset"===t||"longOffset"===t||"shortGeneric"===t||"longGeneric"===t)return t}set timeZoneName(t){this.setAttribute("time-zone-name",t||"")}get prefix(){var t;return null!==(t=this.getAttribute("prefix"))&&void 0!==t?t:"datetime"===this.format?"":"on"}set prefix(t){this.setAttribute("prefix",t)}get threshold(){let t=this.getAttribute("threshold");return t&&D(t)?t:"P30D"}set threshold(t){this.setAttribute("threshold",t)}get tense(){let t=this.getAttribute("tense");return"past"===t?"past":"future"===t?"future":"auto"}set tense(t){this.setAttribute("tense",t)}get precision(){let t=this.getAttribute("precision");return M.includes(t)?t:"micro"===this.format?"minute":"second"}set precision(t){this.setAttribute("precision",t)}get format(){let t=this.getAttribute("format");return"datetime"===t?"datetime":"relative"===t?"relative":"duration"===t?"duration":"micro"===t?"micro":"elapsed"===t?"elapsed":"auto"}set format(t){this.setAttribute("format",t)}get formatStyle(){let t=this.getAttribute("format-style");if("long"===t)return"long";if("short"===t)return"short";if("narrow"===t)return"narrow";let e=this.format;return"elapsed"===e||"micro"===e?"narrow":"datetime"===e?"short":"long"}set formatStyle(t){this.setAttribute("format-style",t)}get datetime(){return this.getAttribute("datetime")||""}set datetime(t){this.setAttribute("datetime",t)}get date(){let t=Date.parse(this.datetime);return Number.isNaN(t)?null:new Date(t)}set date(t){this.datetime=(null==t?void 0:t.toISOString())||""}connectedCallback(){this.update()}disconnectedCallback(){I.unobserve(this)}attributeChangedCallback(t,e,i){e===i||("title"===t&&S(this,r,null!==i&&(this.date&&x(this,a,"m",l).call(this,this.date))!==i,"f"),x(this,n,"f")||"title"===t&&x(this,r,"f")||S(this,n,(async()=>{await Promise.resolve(),this.update()})(),"f"))}update(){let t=x(this,h,"f").textContent||this.textContent||"",e=this.getAttribute("title")||"",i=e,s=this.date;if("undefined"==typeof Intl||!Intl.DateTimeFormat||!s){x(this,h,"f").textContent=t;return}let o=Date.now();!x(this,r,"f")&&(i=x(this,a,"m",l).call(this,s)||"")&&this.setAttribute("title",i);let f=k(s,this.precision,o),g=x(this,a,"m",u).call(this,f),y=t;(y="duration"===g?x(this,a,"m",m).call(this,f):"relative"===g?x(this,a,"m",d).call(this,f):x(this,a,"m",c).call(this,s))?x(this,h,"f").textContent=y:this.shadowRoot===x(this,h,"f")&&this.textContent&&(x(this,h,"f").textContent=this.textContent),(y!==t||i!==e)&&this.dispatchEvent(new RelativeTimeUpdatedEvent(t,y,e,i)),"relative"===g||"duration"===g?I.observe(this):I.unobserve(this),S(this,n,!1,"f")}};r=new WeakMap,n=new WeakMap,h=new WeakMap,f=new WeakMap,a=new WeakSet,o=function(){var t;return(null===(t=this.closest("[lang]"))||void 0===t?void 0:t.getAttribute("lang"))||this.ownerDocument.documentElement.getAttribute("lang")||"default"},l=function(t){return new Intl.DateTimeFormat(x(this,a,"a",o),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)},u=function(t){let e=this.format;if("datetime"===e)return"datetime";if("duration"===e||"elapsed"===e||"micro"===e)return"duration";if(("auto"===e||"relative"===e)&&"undefined"!=typeof Intl&&Intl.RelativeTimeFormat){let e=this.tense;if("past"===e||"future"===e||1===Duration.compare(t,this.threshold))return"relative"}return"datetime"},m=function(t){let e=x(this,a,"a",o),i=this.format,s=this.formatStyle,r=this.tense,n=_;"micro"===i?(t=A(t),n=R,("past"===this.tense&&-1!==t.sign||"future"===this.tense&&1!==t.sign)&&(t=R)):("past"===r&&-1!==t.sign||"future"===r&&1!==t.sign)&&(t=n);let h=`${this.precision}sDisplay`;return t.blank?n.toLocaleString(e,{style:s,[h]:"always"}):t.abs().toLocaleString(e,{style:s})},d=function(t){let e=new Intl.RelativeTimeFormat(x(this,a,"a",o),{numeric:"auto",style:this.formatStyle}),i=this.tense;"future"===i&&1!==t.sign&&(t=_),"past"===i&&-1!==t.sign&&(t=_);let[s,r]=E(t);return"second"===r&&s<10?e.format(0,"second"):e.format(s,r)},c=function(t){let e=new Intl.DateTimeFormat(x(this,a,"a",o),{second:this.second,minute:this.minute,hour:this.hour,weekday:this.weekday,day:this.day,month:this.month,year:this.year,timeZoneName:this.timeZoneName});return`${this.prefix} ${e.format(t)}`.trim()};let N="undefined"!=typeof globalThis?globalThis:window;try{customElements.define("relative-time",relative_time_element_RelativeTimeElement),N.RelativeTimeElement=relative_time_element_RelativeTimeElement}catch(t){if(!(N.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name)&&!(t instanceof ReferenceError))throw t}let L=relative_time_element_RelativeTimeElement}}]);
//# sourceMappingURL=vendors-node_modules_github_relative-time-element_dist_index_js-3056dd3db303.js.map